package com.clz.latte.delegate.bottom;

import com.blankj.utilcode.util.ToastUtils;
import com.clz.latte.R;
import com.clz.latte.app.Latte;
import com.clz.latte.delegate.LatteDaleGate;

/**
 * Created by Administrator on 2018/3/20.
 */

public abstract class BottomItemDelegate extends LatteDaleGate {
    //再按一次退出程序的时间
    private static final long WAIT_TIME = 2000L;
    private long TOUCH_TIME = 0;

    @Override
    public boolean onBackPressedSupport() {
        if (System.currentTimeMillis() - TOUCH_TIME < WAIT_TIME) {
            _mActivity.finish();
        } else {
            TOUCH_TIME = System.currentTimeMillis();
            ToastUtils.showShort("双击退出" + Latte.getAppplication().getString(R.string.app_name), _mActivity);
        }
        return true;
    }
}
